package com.tech.zhidengxian.controller;

import com.tech.zhidengxian.model.dto.CategoryDTO;
import com.tech.zhidengxian.model.dto.result.ReturnResult;
import com.tech.zhidengxian.model.dto.result.ReturnResultUtils;
import com.tech.zhidengxian.service.api.CategoryService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/category")
public class CategoryController {
    @Resource
    private CategoryService categoryService;
    @RequestMapping("/queryCategoryList")
    public ReturnResult<List<CategoryDTO>> queryCategoryList(){
        ReturnResult<List<CategoryDTO>> result = ReturnResultUtils.returnSuccess(categoryService.queryCategoryList());
        return result;
    }

}
